<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}PPress主题应用{% endblock %}</title>
    <link rel="stylesheet" href="{{ url_for('main_static', filename=get_theme() + '/static/css/ppress.css') }}">
    {% block extra_css %}{% endblock %}
</head>
<body>
    <header>
        <nav>
            <div class="container">
                <a href="{{ url_for('main.index') }}" class="logo">{{ get_site() }}</a>
                <input type="checkbox" id="nav-toggle" class="nav-toggle" />
                <label for="nav-toggle" class="nav-toggle-label">
                    <span></span>
                </label>
                <ul class="nav-menu">
                    {% for menu_item in get_menus("primary") %}
                        <li class="{{ 'no-dropdown' if not menu_item.children else '' }}">
                            <a target="{{ menu_item.target }}" href="{{ menu_item.url }}">
                                <img src="{{ url_for('main_static', filename=get_theme() + menu_item.icon ) }}" class="menu-icon" alt="{{ menu_item.navigation_label }}">
                                <span class="menu-text">{{ menu_item.navigation_label }}</span>
                            </a>
                            {% if menu_item.children %}
                                <ul>
                                    {% for sub_item in menu_item.children %}
                                        <li><a target="{{ menu_item.target }}" href="{{ sub_item.url }}">{{ sub_item.navigation_label }}</a></li>
                                    {% endfor %}
                                </ul>
                            {% endif %}
                        </li>
                    {% endfor %}
                </ul>
                <div class="nav-overlay"></div>
            </div>
        </nav>
    </header>

    <main>
        <div class="container">
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }}">{{ message }}</div>
                    {% endfor %}
                {% endif %}
            {% endwith %}

            {% block content %}{% endblock %}
        </div>
    </main>


    {% include get_theme() + '/common/footer.html' %}
    <script src="{{ url_for('main_static', filename=get_theme() + '/static/js/ppress.js') }}"></script>
    {% block extra_js %}{% endblock %}
</body>
</html> 